package com.maleant.mvvm.basemvvm.ui.fragment.adapter;

import android.support.v7.widget.RecyclerView;
import android.view.ViewGroup;

import com.maleant.mvvm.basemvvm.databinding.CommentItemBinding;
import com.maleant.mvvm.basemvvm.model.Comment;
import com.maleant.mvvm.basemvvm.ui.callback.CommentClickCallback;

import java.util.List;

/**
 * Created by ant on 17-12-27.
 */

public class CommentAdapter extends RecyclerView.Adapter<CommentAdapter.CommentViewHolder> {

    private List<? extends Comment> mCommentList;

    private final CommentClickCallback mCommentClickCallback;

    public CommentAdapter(CommentClickCallback mCommentClickCallback) {
        this.mCommentClickCallback = mCommentClickCallback;
    }

    public void setCommentList(final List<? extends Comment> comments) {
        if (mCommentList == null) {
            mCommentList = comments;
            notifyItemRangeInserted(0, comments.size());
        }
    }

    @Override
    public CommentViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return null;
    }

    @Override
    public void onBindViewHolder(CommentViewHolder holder, int position) {

    }

    @Override
    public int getItemCount() {
        return 0;
    }

    static class CommentViewHolder extends RecyclerView.ViewHolder {
        final CommentItemBinding binding;

        public CommentViewHolder(CommentItemBinding binding) {
            super(binding.getRoot());
            this.binding = binding;
        }
    }
}
